<template>
    <router-link tag="div" :to="`/productdetails/${item.tradeItemId}`" class="product" >
        <div class="product-img">
            <van-image :src="item.img">
                <template v-slot:loading>
                    <van-loading type="spinner" size="20" />
                </template>
            </van-image>
        </div>
        <div class="product-describe">
            <div class="product-title van-multi-ellipsis--l2">{{ item.title }}</div>
            <div class="product-price">
                <p class="p-price">价格{{ item.price }}</p>
                <p class="p-sale">销量{{ item.sale ? item.sale : item.cfav }}</p>
            </div>
        </div>
    </router-link>
</template>

<script>
export default {
    props: ["item"],
   
};
</script>

<style lang="scss" scoped>
.product {
    background-color: #fff;
    width: 43vw;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 2vh;
    .product-img {
        width: 100%;
        img {
            width: 100%;
        }
    }
    .product-describe {
        width: 100%;
        height: 5rem;
        padding: 0 1vw;
        box-sizing: border-box;
        .product-title {
            font-size: 16px;
            font-weight: 600;
            line-height: 20px;
            margin-bottom: 1vh;
        }
        .product-price {
            display: flex;
            justify-content: space-between;
            .p-price {
                font-size: 18px;
                font-weight: 600;
                color: red;
            }
            .p-sale {
                font-size: 14px;
                color: rgba($color: #000000, $alpha: 0.7);
            }
        }
    }
}
</style>
